//
//  SettingTableViewCell.m
//  51易借
//
//  Created by 张睿 on 2017/8/28.
//  Copyright © 2017年 张睿. All rights reserved.
//

#import "SettingTableViewCell.h"

@implementation SettingTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}



- (void)setupUI{
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    self.kindLabel = [UILabel new];
    
    self.kindLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    self.kindLabel.textColor = ColorWithRGB(0x303c41);
    self.kindLabel.textAlignment = NSTextAlignmentLeft;
    
    [self.contentView addSubview:self.kindLabel];
    
    [self.kindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.contentView).offset(15 * SCREENH6);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    
    self.rightImageView = [UIImageView new];
    
    self.rightImageView.image = [UIImage imageNamed:@"倒三角-箭头"];
    
    [self.contentView addSubview:self.rightImageView];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.contentView).offset(-15 * SCREENH6);
        make.centerY.mas_equalTo(self.contentView);
        make.width.mas_equalTo(8 * SCREENH6);
        make.height.mas_equalTo(15 * SCREENH6);
    }];
    
    
    self.rightLabel = [CopyLabel new];
    
    self.rightLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    self.rightLabel.textColor = ColorWithRGB(0x303c41);
    self.rightLabel.textAlignment = NSTextAlignmentRight;
    
    [self.contentView addSubview:self.rightLabel];
    
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.contentView).offset(-15 * SCREENH6);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    self.lineView = [UIView new];
    
    self.lineView.backgroundColor = BACK_COLOR;
    
    [self.contentView addSubview:self.lineView];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
        make.height.mas_equalTo(1 * SCREENH6);
        make.leading.mas_equalTo(self.contentView).offset(15 * SCREENH6);
        make.trailing.mas_equalTo(self.contentView).offset(-15 * SCREENH6);
    }];
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
